<?php

namespace common\jobs;

use Yii;
use yii\helpers\Console;

/**
 * 测试队列
 */
abstract class BaseRetryableJob extends \yii\base\BaseObject implements \yii\queue\RetryableJobInterface {

    public $data = [];
    public $time = '';

    /**
     * @inheritdoc
     */
    public function getTtr() {
        return 30;
    }

    /**
     * @inheritdoc
     */
    public function canRetry($attempt, $error) {
        return $attempt < 3;
    }

}
